home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib16.dsk
/
CASH REGISTER.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
3KB
|
75 lines
10 REM **********************
15 REM * THE CASH REGISTER *
20 REM * BY LES SCHMELTZ *
25 REM * COPYRIGHT (C) 1983 *
30 REM * BY MICROSPARC, INC *
35 REM * LINCOLN, MA 01773 *
40 REM **********************
60 HOME : VTAB (11): HTAB (8): INVERSE : PRINT "$$$ THE CASH REGISTER $$$": NORMAL
70 PRINT : PRINT TAB( 13);"BY LES SCHMELTZ": VTAB 20: PRINT "** COPYRIGHT 1983 BY MICROSPARC, INC. **"
80 FOR I = 0 TO 4000: NEXT
90 DIM X(25): GOSUB 1000
110 REM SALE TYPE SELECTION MODULE
120 HOME : PRINT : PRINT TAB( 14);"TYPE OF SALE:": PRINT
130 INPUT "1=CASH 2=CHARGE 3=REFUND 4=TOTALS 5=QUIT";TY
140 IF TY <1 OR TY >5 THEN THEN PRINT : PRINT "SELECT 1-5 ONLY. RE-ENTER.": FOR I = 0 TO 2000: NEXT : GOTO 120
150 ON TY GOTO 200,200,500,700,900
200 REM CASH/CREDIT SALE ENTRY MODULE
210 I = 1:S = 1:TS = 0
220 HOME : PRINT "PRESS RETURN AFTER EACH ITEM."
230 PRINT "ENTER 0 FOR LAST ITEM.": PRINT
240 PRINT "ITEM #";I;" ";: INPUT X(S)
250 IF X(S) = 0 THEN GOTO 280
260 I = I +1:S = S +1: GOTO 240
270 REM TOTAL THIS SALE
280 FOR S = 1 TO I:TS = TS +X(S): NEXT S
290 PRINT : PRINT : PRINT TAB( 8);"TOTAL SALE: ";TS
300 IF ST$ = "Y" THEN TX = INT((TS *TP/100) +.5 *100)/100: PRINT : PRINT TAB( 9);"SALES TAX: ";TX:TS = TS +TX: PRINT : PRINT " TOTAL AMOUNT DUE: ";TS
310 IF TY = 2 THEN GOTO 400
320 PRINT : INPUT " AMOUNT TENDERED: ";TD
330 PRINT : PRINT TAB( 12);"CHANGE: ";TD -TS
340 IT = IT +I:GT = GT +TS:TT = TT +TX
350 PRINT : PRINT "PRESS ANY KEY TO CONTINUE": GET Z$
360 GOTO 120
400 REM CHARGE SALES MODULE
410 IT = IT +1:CT = CT +TS:TT = TT +TX
420 PRINT : PRINT "PRESS ANY KEY TO CONTINUE": GET Z$
430 GOTO 120
500 REM REFUND/CREDIT ROUTINE
510 HOME : PRINT "PRESS RETURN AFTER EACH ITEM."
520 PRINT "ENTER 0 FOR LAST ITEM.": PRINT
530 I = 1:S = 1:TS = 0
540 PRINT "ITEM #";I;" ";: INPUT X(S)
550 IF X(S) < >0 THEN I = I +1:S = S +1: GOTO 540
560 FOR S = 1 TO I:TS = TS +X(S): NEXT S
570 PRINT : PRINT "TOTAL OF ITEMS: ";TS
580 IF ST$ = "Y" THEN TX = INT((TS *TP/100) +.5 *100)/100: PRINT TAB( 6);"SALES TAX: ";TX: PRINT " TOTAL CREDIT: ";TS +TX
590 PRINT : PRINT "SELECT: 1=CASH REFUND 2=CREDIT TO ACCT": INPUT RF
600 IF RF = 1 THEN IT = IT -I:GT = GT -TS:TT = TT -TX: GOTO 620
610 IT = IT -1:CT = CT -TS:TT = TT -TX
620 PRINT : PRINT "PRESS ANY KEY TO CONTINUE": GET Z$
630 GOTO 120
700 REM PRINT TOTALS
710 HOME : VTAB (3): PRINT TAB( 14);: INVERSE : PRINT "SALES SUMMARY": NORMAL
720 PRINT : PRINT TAB( 19);"ITEMS ";IT
730 PRINT :X = GT: GOSUB 910:GT$ = X$: PRINT TAB( 14);"CASH SALES:"; TAB( TB);GT$
740 PRINT :X = CT: GOSUB 910:CT$ = X$: PRINT TAB( 12);"CREDIT SALES:"; TAB( TB);CT$
750 PRINT :X = GT +CT: GOSUB 910: PRINT TAB( 16);"SUBTOTAL:"; TAB( TB);X$
760 IF ST$ = "Y" THEN PRINT :X = TT: GOSUB 910:TT$ = X$: PRINT TAB( 15);"SALES TAX:"; TAB( TB);TT$
770 PRINT :X = GT +CT +TT: GOSUB 910: PRINT TAB( 10);"TOTAL RECEIPTS:"; TAB( TB);X$
780 PRINT : PRINT : PRINT TAB( 10);"PRESS ANY KEY FOR MENU": GET Z$
790 GOTO 120
900 END
910 REM ROUTINE TO JUSTIFY DISPLAY
920 X$ = STR$(X)
930 FOR I = 1 TO LEN(X$)
940 IF MID$ (X$,I,1) = "." THEN J = I
950 NEXT I
960 IF J = LEN(X$) THEN X$ = X$ +".00"
970 IF J = LEN(X$) -1 THEN X$ = X$ +"0"
980 TB = 33 - LEN(X$)
990 RETURN
1000 REM SELECT SALES TAX ROUTINE
1010 HOME : VTAB (11): INPUT "INCLUDE SALES TAX? (Y/N)";ST$
1020 IF ST$ = "Y" THEN PRINT : INPUT "TAX PERCENTAGE? (0-10):";TP
1030 RETURN